function [ blip, t ] = get_blip( amiga_model, audio_filter_mode,  method, ... 
    filter_method, length )
% amiga_model - '', 'a500', 'a1200'
% audio_filter_mode - 'led filter on', 'led filter off', 'unfiltered'
% method - 'math direct', 'math fq', 'math ts', 'math lsim', 'winuae', 'python', 'spice fq'
% filter_method - 'none', 'conv', 'fq', 'lsim'
% length - 'short', 'full'

% default params

if (nargin < 3)
    error('not sufficient parameters');
end

if (nargin < 4)
    if strcmpi(method, 'math lsim')
        filter_method = 'lsim';
    elseif strcmpi(method, 'winuae') || strcmpi(method, 'python')
        filter_method = 'lsim';
    else
        filter_method = 'conv';
    end
end

if (nargin < 5)
    length = 'short';
end

% check params

check_str_param(amiga_model, {'', 'a500', 'a500 winuae', 'a1200', ... 
    'a1200 winuae'});
check_str_param(audio_filter_mode, {'led filter on', 'led filter off', ...
    'unfiltered', 'led filter only'});

check_str_param(method, {'math direct', 'math fq', 'math ts', ...
    'math lsim', 'winuae', 'python', 'spice fq'});
check_str_param(filter_method, {'none', 'conv', 'fq', 'lsim'});

if strcmpi(method, 'winuae') || strcmpi(method, 'python')
    if ~strcmpi(filter_method, 'lsim')
        error('bad method and filter_method parameter');
    end
end

check_str_param(length, {'short', 'full'});

% get proper blip

switch lower(method)
    case 'math direct'
        [ blip, tout ] = get_blip_math_direct(amiga_model, ... 
            audio_filter_mode, filter_method, length);
    case 'math fq'
        [ blip, tout ] = get_blip_math_fq(amiga_model, audio_filter_mode, ... 
            filter_method, length);
    case 'math ts'
        [ blip, tout ] = get_blip_math_ts(amiga_model, audio_filter_mode, ... 
            filter_method, length);
    case 'math lsim'
        [ blip, tout ] = get_blip_math_lsim(amiga_model, ... 
            audio_filter_mode, filter_method, length);
    case 'winuae'
        [ blip, tout ] = get_blip_winuae(amiga_model, audio_filter_mode);
    case 'python'
        [ blip, tout ] = get_blip_python(amiga_model, audio_filter_mode);
    case 'spice fq'
        [ blip, tout ] = get_blip_spice(amiga_model, audio_filter_mode, ... 
             filter_method, length);
end

if (nargout == 2)
    t = tout;
end

end


